package net.shouyong.topbilliards.bean;

import net.shouyong.topbilliards.bean.BilliardRecord;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;

/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 * <p>
 * TODO: Replace all uses of this class before publishing your app.
 */
public class BilliardRecordContent {

    /**
     * An array of sample (dummy) items.
     */
    public static final List<BilliardRecord> ITEMS = new ArrayList<BilliardRecord>();

    /**
     * A map of sample (dummy) items, by ID.
     */
    public static final Map<String, BilliardRecord> ITEM_MAP = new HashMap<String, BilliardRecord>();

    private static final int COUNT = 4;

    static {
        // Add some sample items.
        for (int i = 1; i <= COUNT; i++) {
            if (i <= 2) {
                addItem(createDummyItem(i, 15));
            }else{
                addItem(createDummyItem(i, 10));
            }
        }
    }

    private static void addItem(BilliardRecord item) {
        ITEMS.add(item);
        ITEM_MAP.put(String.valueOf(item.getIndex()), item);
    }

    public static BilliardRecord createDummyItem(int index, int unitPrice) {
        BilliardRecord dummy = new BilliardRecord();
        dummy.setIndex(index);
        dummy.setUnitPrice(unitPrice);
        return dummy;
    }


}
